package day02;

/**
 * @ClassName Singlemould
 * @Description TODO
 * @Author hp
 * @Date 2021/6/17 16:14
 * @Version 1.0
 **/


public class SingleMould {
/*    //饿汉模式
    private  static  SingleMould singleMould = new SingleMould();

    private SingleMould() {
    }
    public static SingleMould getInstance(){
        return singleMould;
    }*/

//    懒汉模式
    private static SingleMould singleMould;
    private SingleMould(){}
    public static SingleMould getInstacne(){
        if (singleMould == null){
            singleMould = new SingleMould();
        }
        return singleMould;
    }

}

